Call-by-value isn’t dual to call-by-name, call-by-name is dual to call-by-value!

نویسنده

  • Harry G. Mairson
چکیده

Gentzen’s sequent calculus for classical logic shows great symmetry: for example, the rule introducing ∧ on the left of a sequent is mirror symmetric to the introduction rule for the dual operator ∨ on the right of a sequent. A consequence of this casual observation is that when Γ ` ∆ is a theorem over operators {∨,∧,¬}, then so is ∆ ` Γ, where Σ reverses the order of formulas in Σ, and exchanges each instance of A ∧B (C ∨D) in a formula of Σ with B ∨ A (D ∧ C). This symmetry of rules means that the duality of theorems is also a duality of proof structures. When introducing implication (→), the duality of theorems can be recovered by a translation (say, A → B ≡ ¬A ∨ B), but the duality of proofs is naively lost. By instead adding a logically redundant coimplication ←, that duality is restored. A classical Curry-Howard correspondence then dualizes application and λ-abstraction over expression variables, which implement→, with co-application and co-λ-abstraction over continuation variables, which implement ←. The proof syntax and programming language we recover is Filinski’s symmetric λ-calculus [3], augmented with a certain facility in naming continuations found in λμ-calculus [17]. The dual calculus of [18] lacks λ, encoding it instead using primitive operators—in particular, using computationally redundant sharing. It is from such nonlinearity that confluence is lost in normalization of classical proofs, which is why call-by-name and call-by-value translations are used to restore it. Interpreted from a linear logic perspective, this encoding unnecessarily requires two copies of every procedure calling context, because the dual calculus lacks the computational power of . Further, the call-by-value and call-by-name encodings of λ and @ are not isomorphic, nor do they have duals. The symmetric λ-calculus invites no such complication or redundancy, and its call-by-name and call-by-value CPS translations are dual. Using a direct-style translation that we introduced in [14], where the administrative redexes of CPS translation are eliminated and re∗Supported by NSF Grants CDA-9806718, CCR-0228951, and the Tyson Foundation. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. CW04, January 17, Venice, Italy. Copyright 2004 ACM 1-58113-756-7/03/0008 ...$5.00. placed by a boxing strategy, dual CBN and CBV proofnets are recovered. These proofnets elaborate the dual, confluent proof structures with explicit sharing, and identify explicitly the coroutined alternation in evaluation of expressions and continuations. The language is then built from four kinds of pairing (with complementary unpairing): of two expressions (a product), two continuations (a coproduct), a continuation and expression (application context), and an expression and continuation (co-application context).

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Duality between Call-by-Name Recursion and Call-by-Value Iteration

We investigate the duality between call-by-name recursion and call-by-value iteration in the λμ-calculi and their models. Semantically, we consider that iteration is the dual notion of recursion. Syntactically, we extend the call-by-name λμ-calculus and the call-by-value one with a fixed-point operator and an iteration operator, respectively. This paper shows that the dual translations between ...

متن کامل

Call-by-Value and Call-by-Name Dual Calculi with Inductive and Coinductive Types

This paper extends the dual calculus with inductive types and coinductive types. The paper first introduces a non-deterministic dual calculus with inductive and coinductive types. Besides the same duality of the original dual calculus, it has the duality of inductive and coinductive types, that is, the duality of terms and coterms for inductive and coinductive types, and the duality of their re...

متن کامل

Application of Monte Carlo Simulation in the Assessment of European Call Options

In this paper, the pricing of a European call option on the underlying asset is performed by using a Monte Carlo method, one of the powerful simulation methods, where the price development of the asset is simulated and value of the claim is computed in terms of an expected value. The proposed approach, applied in Monte Carlo simulation, is based on the Black-Scholes equation which generally def...

متن کامل

Intuitionistic Dual-intuitionistic Nets

The intuitionistic sequent calculus (at most one formula on the right-hand side of sequents) comes with a natural dual system: the dual-intuitionistic sequent calculus (at most one formula on the left-hand side). We explain how the duality between these two systems exactly corresponds to the intensively studied duality between call-by-value systems and call-by-name systems for classical logic. ...

متن کامل

Evaluation strategies for monadic computations

computations and comonads. In this paper, we extended monads with one component of a comonadic structure. Although less widespread than monads, comonads are also useful for capturing abstract computations in functional programming. They have been used for dataflow programming [23], array programming [17], environment passing, and more [8]. In general, comonads can be used to describe context-de...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2004